﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace Dmo_lc_2.Shape
{
    public class SolidShape : BaseShape
    {
        public int weight { get; set; }

        public List<double[]> vertices;
        public double[] normal;


        public SolidShape(Entity in_entity, Transaction tr) : base(in_entity, tr)
        {
        }

        public override void Init() {
            shapeType = ShapeType.SOLID;
            shapeTypeName = shapeType.ToString();

            Solid tempEntity = (Solid)mEntity;
            vertices = new List<double[]> { };

            for (short i = 0; i < 4; i++) {
                Point3d p = tempEntity.GetPointAt(i);

                double[] dp = { p.X, p.Y, p.Z };
                vertices.Add(dp);
            }

            color = getColor();
            normal = new double[] { tempEntity.Normal.X, tempEntity.Normal.Y, tempEntity.Normal.Z };
        }
    }
}